package model;

import java.io.Serializable;
import java.util.Date;

public class EmployeeDTO implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private int employeeID;
	private String firstName;
	private String surName;
	private String designation;
	private String role;
	private String telNumber;
	private String address;
	private String email;
	private String password;
	private int managerID;
	private String gender;
	private String nric;

	private Date startDate;
	private Date endDate;
	private double period;
	private String reason;
	private int workDissmenition;
	private String status;
	private String comment;
	private int createBy;
	private Date createDate;

	private String name;

	public EmployeeDTO() {
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public EmployeeDTO(int employeeID) {

		this.employeeID = employeeID;
	}

	public int getEmployeeID() {
		return this.employeeID;
	}

	public void setEmployeeID(int employeeID) {
		this.employeeID = employeeID;
	}

	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getSurName() {
		return this.surName;
	}

	public void setSurName(String surName) {
		this.surName = surName;
	}

	public String getDesignation() {
		return this.designation;
	}

	public void setDesignation(String designation) {
		this.designation = designation;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getTelNumber() {
		return this.telNumber;
	}

	public void setTelNumber(String telNumber) {
		this.telNumber = telNumber;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getManagerID() {
		return this.managerID;
	}

	public void setManagerID(int managerID) {
		this.managerID = managerID;
	}

	public String getGender() {
		return this.gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getNric() {
		return this.nric;
	}

	public void setNric(String nric) {
		this.nric = nric;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public double getPeriod() {
		return period;
	}

	public void setPeriod(double period) {
		this.period = period;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public int getWorkDissmenition() {
		return workDissmenition;
	}

	public void setWorkDissmenition(int workDissmenition) {
		this.workDissmenition = workDissmenition;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public int getCreateBy() {
		return createBy;
	}

	public void setCreateBy(int createBy) {
		this.createBy = createBy;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public void setAll(int employeeID, String firstName, String surName,
			String designation, String role, String telNumber, String address,
			String email, String password, int managerID, String gender,
			String nric) {
		this.employeeID = employeeID;
		this.firstName = firstName;
		this.surName = surName;
		this.designation = designation;
		this.role = role;
		this.telNumber = telNumber;
		this.address = address;
		this.email = email;
		this.password = password;
		this.managerID = managerID;
		this.gender = gender;
		this.nric = nric;
	}

	public boolean hasEqualMapping(EmployeeDTO valueObject) {

		if (valueObject.getEmployeeID() != this.employeeID) {
			return (false);
		}
		if (this.firstName == null) {
			if (valueObject.getFirstName() != null)
				return (false);
		} else if (!this.firstName.equals(valueObject.getFirstName())) {
			return (false);
		}
		if (this.surName == null) {
			if (valueObject.getSurName() != null)
				return (false);
		} else if (!this.surName.equals(valueObject.getSurName())) {
			return (false);
		}

		return true;
	}

	public String toString() {
		StringBuffer out = new StringBuffer();
		out.append("employeeID = " + this.employeeID + "\n");
		out.append("firstName = " + this.firstName + "\n");
		out.append("surName = " + this.surName + "\n");
		out.append("designation = " + this.designation + "\n");
		out.append("role = " + this.role + "\n");
		out.append("telNumber = " + this.telNumber + "\n");
		out.append("address = " + this.address + "\n");
		out.append("email = " + this.email + "\n");
		out.append("password = " + this.password + "\n");
		out.append("managerID = " + this.managerID + "\n");
		out.append("gender = " + this.gender + "\n");
		out.append("nric = " + this.nric + "\n");
		return out.toString();
	}

}
